/* eslint valid-jsdoc: "off" */

'use strict';
const path = require('path');

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1593281995158_5465';

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
    mysql: {
      client: {
        // host
        host: 'gz-cdb-0bseqrd9.sql.tencentcdb.com',
        // 端口号
        port: '60006',
        // 用户名
        user: '2023_project',
        // 密码
        password: '2023_project',
        // 数据库名
        database: '2023_project'
      },

      app: true
    },
    security: {
      csrf: {
        enable: false
      },
      domainWhiteList: []
    },
    cors: {
      origin: '*',
      allowMethods: 'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS'
    },
    savePath: path.join(__dirname, '../upload'),
    assetsURL: 'http://127.0.0.1:8040/public',
  };

  return {
    ...config,
    ...userConfig
  };
};
